import request from "@/utils/request"

// 查询
export function orderList(data) {
  return request({
    url: "/system/order/listV2",
    method: "post",
    data: data,
  })
}
// 查询工单数
export function getCount(data) {
  return request({
    url: "/system/order/count",
    method: "post",
    data: data,
  })
}

// 获取工单类型
export function getSlaList() {
  return request({
    url: "/system/setting/list",
    method: "get",
  })
}
// 创建工单
export function createOrderList(data) {
  return request({
    url: "/system/order",
    method: "post",
    data: data,
  })
}
// 开始处理工单
export function updateOrderList(data) {
  return request({
    url: "/system/order/editV2",
    method: "post",
    data: data,
  })
}

// 获取责任人
export function getAllocatedList(data) {
  return request({
    url: "/system/role/authUser/allocatedList2",
    method: "get",
    params: data,
  })
}
// 获取流转日志
export function getLogList(data) {
  return request({
    url: "/system/log/orderLog/" + data,
    method: "get",
    params: data,
  })
}


// 工单数量统计借口
export function getDept() {
  return request({
    url: "/system/orderCount/dept",
    method: "get",
  })
}

// 超时最多员工统计
export function getUserTimeOut() {
  return request({
    url: "/system/orderCount/userTimeOut",
    method: "get",
  })
}


// 当天各状态统计
export function getCountByStatus() {
  return request({
    url: "/system/orderCount/countByStatus",
    method: "get",
  })
}


// 最近7天各状态统计
export function getCountLast7Days() {
  return request({
    url: "/system/orderCount/countLast7Days",
    method: "get",
  })
}

// 获取对话记录列表
export function getAIRecord(data = {}) {
  return request({
    url: "/system/order/getAIRecord",
    method: "get",
    params: data
  })
}
// 获取通话语音流
export function getAudioFile(data) {
  return request({
    url: "/system/order/getAudio/"+ data,
    method: "get",
    responseType: 'blob',
    isBlob : true
  })
}